<template>
  <div class="DailyInfoFill_box">
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <div class="header">日常纳税情况申报 <br /></div>
      </div>
      <div class="header1">基本信息</div>
      <el-form
        :model="ruleForm"
        :rules="rules"
        ref="ruleForm"
        label-width="140px"
        class="demo-ruleForm"
      >
        <div class="flexClass">
          <!-- 填报人 -->
          <el-form-item class="inputForm" label="填报人" prop="name">
            <el-input v-model="ruleForm.name"></el-input>
          </el-form-item>
          <!--申报单位  -->
          <el-form-item class="inputForm" label="申报单位" prop="region">
            <el-select v-model="ruleForm.region" placeholder="请选择活动区域">
              <el-option label="区域一" value="shanghai"></el-option>
              <el-option label="区域二" value="beijing"></el-option>
            </el-select>
          </el-form-item>

          <!-- 所属会计期间 -->
          <el-form-item class="inputForm" label="所属会计期间" required>
            <el-col :span="3">
              <el-form-item prop="date1">
                <el-date-picker
                  v-model="ruleForm.date1"
                  type="date"
                  placeholder="选择日期"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
          </el-form-item>
        </div>

        <el-form-item label="缴费说明" prop="desc" class="jiaofeiCalss">
          <el-input type="textarea" v-model="ruleForm.desc"></el-input>
        </el-form-item>
      </el-form>
    </el-card>
    <!-- 表格 -->

    <el-card class="MonthlyDeclarationForm_box">
      <div slot="header" class="clearfix">
        <span>缴税详情</span>
        <div class="tabel_box">
          <el-table :data="tableData" border style="width: auto">
            <!-- 缴纳税种 -->
            <el-table-column label="缴纳税种" width="auto">
              <template slot-scope="scope">
                <span style="margin-left: 10px">{{ scope.row.title }}</span>
              </template>
            </el-table-column>
            <!-- 所属项目 -->
            <el-table-column label="所属项目" width="auto">
              <template slot-scope="scope"> {{ scope.row.name }}</template>
            </el-table-column>

            <!--  决策招标-->
            <el-table-column label="决策招标" width="auto">
              <template slot-scope="scope"> {{ scope.row.zhao }}</template>
            </el-table-column>
            <!--  预计指标-->
            <el-table-column label="预计指标" width="auto">
              <template slot-scope="scope"> {{ scope.row.zhibiao }}</template>
            </el-table-column>
            <!--  积累纳税-->
            <el-table-column label="积累纳税" width="auto">
              <template slot-scope="scope"> {{ scope.row.nashui }}</template>
            </el-table-column>
            <!--  应纳税额-->
            <el-table-column :index="indexMethod" label="应纳税额" width="auto">
              <template slot-scope="scope">
                <el-input
                  v-model="form[`input${scope.row.$index}`]"
                  placeholder="请输入内容"
                >
                </el-input>
              </template>
            </el-table-column>
            <!--  抵扣-->
            <el-table-column label="抵扣" width="auto">
              <template slot-scope="scope">
                <el-checkbox v-model="checked"></el-checkbox>
              </template>
            </el-table-column>
            <!--  抵扣金额-->
            <el-table-column label="抵扣金额" width="auto">
              <template slot-scope="scope"> {{ scope.row.name }}</template>
            </el-table-column>
            <!--  指标使用占比-->
            <el-table-column label="指标使用占比" width="auto">
              <template slot-scope="scope"> {{ scope.row.name }}</template>
            </el-table-column>
            <!--  年度计划使用占比-->
            <el-table-column label="抵扣金额" width="auto">
              <template slot-scope="scope"> {{ scope.row.name }}</template>
            </el-table-column>
            <!-- 状态 -->
            <el-table-column label="状态" width="auto">
              <template slot-scope="scope">
                <div
                  :class="{ zhuangtaiColorClass: scope.row.name }"
                  class="zhuangtaiClass"
                ></div>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
    </el-card>

    <!--  -->
    <!-- 月度申报表 -->
    <el-card class="MonthlyDeclarationForm_box">
      <div slot="header" class="clearfix">
        <span>月度申报表</span>
      </div>
      <el-upload
        class="upload-demo"
        action="https://jsonplaceholder.typicode.com/posts/"
        :on-change="handleChange"
      >
        <el-button size="small" type="primary">点击上传</el-button>
      </el-upload>
      <div class="but">
        <el-button type="primary" @click="submitForm('ruleForm')"
          >保存</el-button
        >
        <el-button @click="resetForm('ruleForm')">上报</el-button>
      </div>
    </el-card>
    <!--申报日志  -->
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span>申报日志</span>
      </div>
      <el-table :data="tableData" border style="width: auto">
        <!-- 审批节点 -->
        <el-table-column label="审批节点" width="auto">
          <template slot-scope="scope">
            <span style="margin-left: 10px">{{ scope.row.title }}</span>
          </template>
        </el-table-column>
        <!-- 审批意见 -->
        <el-table-column label="审批意见" width="auto">
          <template slot-scope="scope"> {{ scope.row.name }}</template>
        </el-table-column>

        <!--  审批人-->
        <el-table-column label="审批人" width="auto">
          <template slot-scope="scope"> {{ scope.row.zhao }}</template>
        </el-table-column>
        <!--  审批时间-->
        <el-table-column label="审批时间" width="auto">
          <template slot-scope="scope"> {{ scope.row.zhibiao }}</template>
        </el-table-column>
        <!--  操作-->
        <el-table-column label="操作" width="auto">
          <template slot-scope="scope">
            <el-button>上报</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>
<script >
export default {
  name: "DailyInfoFill",
  data() {
    return {
      checked: true,
      tableData: [
        {
          title: "税种",
          name: "万达集团",
          zhao: "--",
          zhibiao: "1700.12",
          nashui: 22,
        },

        // {
        //   title: "税种1",
        //   name: "万达集团",
        //   zhao: "上海市普陀区金沙江路 1517 弄",
        // },
        // {
        //   title: "税种2",
        //   name: "万达集团",
        //   zhao: "上海市普陀区金沙江路 1519 弄",
        //   zhibiao
        // },
        // {
        //   title: "税种3",
        //   name: "万达集团",
        //   zhao: "上海市普陀区金沙江路 1516 弄",
        // },
      ],
      form: {},
      ruleForm: {
        name: "",
        region: "",
        date1: "",
        date2: "",
        delivery: false,
        type: [],
        resource: "",
        desc: "",
      },
      rules: {
        name: [
          { required: true, message: "请输入活动名称", trigger: "blur" },
          { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
        ],
        region: [
          { required: true, message: "请选择活动区域", trigger: "change" },
        ],
        date1: [
          {
            type: "date",
            required: true,
            message: "请选择日期",
            trigger: "change",
          },
        ],
        date2: [
          {
            type: "date",
            required: true,
            message: "请选择时间",
            trigger: "change",
          },
        ],

        resource: [
          { required: true, message: "请选择活动资源", trigger: "change" },
        ],
        desc: [{ required: true, message: "请填写活动形式", trigger: "blur" }],
      },
    };
  },
  methods: {
    indexMethod(index) {
      return index * 2;
    },
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          alert("submit!");
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
    handleChange() {},
  },
};
</script>

<style scoped lang='scss'>
.DailyInfoExecuteFill_box {
  padding: 60px !important ;
}
.flexClass {
  display: flex;
}
.header1 {
  margin-bottom: 20px;
  margin-left: 50px;
}
.header {
  color: #498ab8;
  margin-bottom: 20px;
}

.jiaofeiCalss {
  width: 60.8%;
}
// 表单input
.inputForm {
  margin-right: 10px;
}
//表格box
.tabel_box {
  margin-top: 10px;
}
// 表格状态
.zhuangtaiClass {
  width: 20px;
  height: 20px;
  border-radius: 50px;
  background-color: red;
}
// 表格状态颜色
.zhuangtaiColorClass {
  background-color: #6ccf60;
}
.MonthlyDeclarationForm_box {
  margin-top: 20px;
  text-align: center;
  position: relative;
}
.clearfix {
  text-align-last: left;
}
.but {
  position: absolute;
  right: 100px;
  bottom: 10px;
}
</style>